<?php

/**
 * Editionoptions filter form base class.
 *
 * @package    briefing
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseEditionoptionsFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'is_technical_terms'   => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'is_foraign_word'      => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'is_superlative'       => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'is_old_language'      => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'is_start_of_sentence' => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'ownchoiceid'          => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Ownchoice'), 'add_empty' => true)),
      'moretext'             => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'is_technical_terms'   => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'is_foraign_word'      => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'is_superlative'       => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'is_old_language'      => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'is_start_of_sentence' => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'ownchoiceid'          => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Ownchoice'), 'column' => 'idownchoice')),
      'moretext'             => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('editionoptions_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Editionoptions';
  }

  public function getFields()
  {
    return array(
      'ideditionoptions'     => 'Number',
      'is_technical_terms'   => 'Boolean',
      'is_foraign_word'      => 'Boolean',
      'is_superlative'       => 'Boolean',
      'is_old_language'      => 'Boolean',
      'is_start_of_sentence' => 'Boolean',
      'ownchoiceid'          => 'ForeignKey',
      'moretext'             => 'Text',
    );
  }
}
